package com.tencent.qcloud.tuikit.tuichat.callback;

import android.content.Context;

import com.tencent.qcloud.tuikit.tuichat.bean.message.CustomRedPackageMessageBean;
import com.tencent.qcloud.tuikit.tuichat.classicui.interfaces.IChatLayout;
import com.tencent.qcloud.tuikit.tuichat.classicui.widget.ChatView;

public class ChatAppModule {
    private static ChatAppModule chatAppModule;
    private AppModuleCallback callback;

    public static ChatAppModule init() {
        if (chatAppModule == null) {
            chatAppModule = new ChatAppModule();
        }
        return chatAppModule;
    }

    public void setCallback(AppModuleCallback callback) {
        this.callback = callback;
    }

    //发红包
    public void performSendRedPackageAction(IChatLayout view, boolean isGroup, String ID) {

        // 当操作完成时，调用回调方法
        if (callback != null) {
            callback.onSendRedPackageActionCompleted(view, isGroup, ID);
        }
    }

    //收红包
    public void performGetRedPackageActionChat(Context context, CustomRedPackageMessageBean msg) {

        // 当操作完成时，调用回调方法
        if (callback != null) {
            callback.onGetRedPackageActionCompleted(context,msg);
        }
    }

    //名片
    public void performBusinessCardActionChat(String ID) {

        // 当操作完成时，调用回调方法
        if (callback != null) {
            callback.onBusinessCardActionCompleted(ID);
        }
    }

    public interface AppModuleCallback {
        public void onSendRedPackageActionCompleted(IChatLayout view, boolean isGroup, String ID);

        public void onGetRedPackageActionCompleted(Context context, CustomRedPackageMessageBean msg);

        public void onBusinessCardActionCompleted(String ID);
    }
}
